<template>
  <!-- 推荐歌单 -->
  <div id="pushSongSheet">
    <header>
      <div class="left">推荐歌单</div>
      <van-icon style="padding-top: 13px"
                size="20"
                name="arrow" />
    </header>
    <van-grid :border="false"
              :column-num="3">
      <van-grid-item v-for="(item, index) in songSheetData"
                     :key="index"
                     @click="handleOpenSong(item)">
        <van-image :src="item.picUrl" />
        <span class="van-multi-ellipsis--l2 songName">{{ item.name}}</span>
      </van-grid-item>
    </van-grid>
  </div>
</template>

<script>
import { getSong } from '@/api/find'
export default {
  name: 'pushSongSheet',
  data() {
    return {
      songSheetData: [],
    }
  },
  methods: {
    handleOpenSong(row) {
      this.$router.push({
        path: `/songSheet`,
        query: {
          id: row.id,
        },
      })
    },
  },
  created() {
    getSong().then((res) => {
      this.songSheetData = res.result
    })
  },
}
</script>

<style scoped>
#pushSongSheet {
  width: 100%;
  height: 100%;
}
#pushSongSheet header {
  display: flex;
}
.left {
  padding: 10px 0 0 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 500;
  font-size: 18px;
}
.songName {
  font-size: 12px;
}
</style>